<?php
 if (!defined('baseinfo')) {
    exitdata();
}  
?>
<div class="sB sBL clBg2 userSlctNone">
    <div class="sBLShdw"></div>
    <div class="wrpInSB">
        <div class="secTopSB clBd2 bdBtm w232">
            <form class="frmSrch" id="frmSrchData">
                  <input type="text" name="qSrch" id="qSrch" value="<?=$data['searchtext']?>" placeholder="Search" autocomplete="off" class="srchTopInp clBd2 fs02">
                  <div class="wrpBtnSrch">
                    <input type="submit" value="" class="srchSbmt">
                    <span class="srchIcon ico"></span>
                  </div>
            </form>
        </div>
        <div class="wrpSecList w232">
            <div class="secWrpList btnSBPf" onclick="toggleUserMenu();setcookiestate()">

                <img src="<? if(count($data['user'])){echo $data['user']['simguser'];}else {echo baseinfo.'/img/dfthmbuser.jpg';} ?>" alt="" width="24" height="24" class="imgSBPf">
                <h3 class="nameSBPf cutTxt fs03 clTxt1"><? if(count($data['user'])){ echo $data['user']['displayname'];   }else { echo "Guest"; }?></h3>
                 <?if(isset($data['user']['credit'])&&creditenable==1){?>
                <span class="creditSB fs00 clTxt3"><a href="javascript:void(0)"><?=$data['user']['credit']?> Coins</a></span>
                <?}?>
                <span class="ico  icoArwUpUser <?if(count($data['user'])){ ?> icoArwDwnUser <? }else if($_COOKIE['stateclick']==2){?>icoArwDwnUser<?}?>"></span>
            </div>
            <div class="secWrpList navUserItem w232" <?if(count($data['user'])){ ?> style="display: none;" <? }else if($_COOKIE['stateclick']==2){?> style="display: none;" <?}?> >
                <h4 class="sprSec clTxt1 clBd2" >account</h4>
                <ul class="grpSecListItem fs03">
                    <?if(count($data['user'])==0){?>
                    <li class="listItem"><a class="btnLstSBL btnLstLI" data-href="Log In">Log In</a></li>
                    <li class="listItem"><a class="btnLstSBL btnLstSU" data-href="Sign Up">Sign Up</a></li>
                    <?}else{?>
                    <li class="listItem <?if($data['templateuser']==1){?>tabSbActived<?}?>"><a class="btnLstSBL " href="<?=baseinfo.'/'.$data['user']['username']?>" data-href="Profile">Profile</a></li>
                    
                                <?// if (!defined('NewFeedCheck')) {?>
                    <li class="listItem <?if($data['templateuser']==3){?>tabSbActived<?}?>"><a class="btnLstSBL" href="<?=baseinfo.'/'.$data['user']['username']?>?myfeed=1" data-href="My Feeds">Feeds</a></li>
                    <?//}?>
                    
                    <li class="listItem <?if($data['templateuser']==2){?>tabSbActived<?}?>"><a class="btnLstSBL " href="<?=baseinfo.'/'.$data['user']['username'].'/favorites'?>" data-href="My Favorites">Bookmark</a></li>    
                   
                    <? if (NearByCheck!=0) {?>
                    <li class="listItem <?if($data['templateuser']==4){?>tabSbActived<?}?>"><a class="btnLstSBL " href="<?=baseinfo.'/nearby'?>" data-href="Near By">Nearby</a></li>
                     <?}?>
                     
                     <?if(NameDmconnex=="Infostant"||NameDmconnex=="Tomorrow Comes Today"){?>
                     <li class="listItem"><a class="btnLstSBL" id="cartlinkbtn" href="<?=baseinfo.'/cart'?>" data-href="My Favorites">Cart</a></li>   
                     <?}?>
                     <?if($data['user']['roleid']==3){?>
                      <li class="listItem"><a class="btnLstSBL " href="<?=baseinfo.'/dmmanager'?>" data-href="My Favorites">Management</a></li>   
                      <?}?>
                      <?if(defined('gameshow')){?>
                      <li class="listItem"><a class="btnLstSBL " href="<?=baseinfo.'/game'?>" data-href="My Favorites">Gamification</a></li>   
                    <?}?>
                    
                    
                    
                    
                   <!-- <li class="listItem"><a class="btnLstSBL" data-href="Near By">Near By</a></li>
                    <li class="listItem"><a class="btnLstSBL" data-href="Cart">Cart</a></li>
                    <li class="listItem"><a class="btnLstSBL" data-href="My Trips">My Trips</a></li>-->
                    <li class="listItem <?if($data['templatefollow']&&$data['isuserpage']){?>tabSbActived<?}?>"><a class="btnLstSBL " href="<?=baseinfo.'/'.$data['user']['username'].'/followers'?>" data-href="Follow">Follow</a></li>
                    <li class="listItem <?if($data['templatemessages']==1){?>tabSbActived<?}?>" ><a class="btnLstSBL" href="<?=baseinfo.'/'.$data['user']['username'].'/messages'?>" data-href="Message">Message</a></li>
                    
                    <?if(intval($data['user']['roleid'])>2){?>
                    <li class="listItem"><a class="btnLstSBL" href="javascript:void(0)" onclick="openbroadcasting()" data-href="Broadcast"><?if (defined('BoardCastData')) { echo BoardCastData;?><?}else{?>Broadcast  <?}?></a></li>
                    <?}?>
                    
                      <?if(intval($data['user']['roleid'])==3){?>
                    <li class="listItem"><a class="btnLstSBL" href="javascript:void(0)" onclick="opennotify()" data-href="Broadcast"><?if (defined('Notify')) { echo Notify;?><?}else{?>Notify<?}?></a></li>
                    <?}?>
                    
                    
                    <?if(intval($data['user']['roleid'])>2&&NameDmconnex=="Infostant"){?>
                    <li class="listItem"><a class="btnLstSBL" href="<?=baseinfo.'/cartmanage'?>" ><?if (defined('Cartmanage')) { echo Cartmanage;?><?}else{?>Cart Manage <?}?></a></li>
                    <?}?>
                    
                    
                    
                    <li class="listItem <?if($data['templatesuggetion']){?>tabSbActived<?}?>" ><a  href="<?=baseinfo.'/'.$data['user']['username']?>/friendssuggestion" class="btnLstSBL" data-href="Friends Suggesion">Friends Suggestion</a></li>
                    <!--<li class="listItem"><a class="btnLstSBL" data-href="Statistic">Statistic</a></li>-->
                    <li class="listItem <?if($data['templatesetting']==1){?>tabSbActived<?}?>"><a class="btnLstSBL " href="<?=baseinfo.'/setting'?>" data-href="Setting">Settings</a></li>
        <!--            <li class="listItem"><a class="btnLstSBL" data-href="Upgrade">Upgrade</a></li>-->
                    <li class="listItem"><a class="btnLstSBL" href="<?=serviceinfo.'logout?linkto='.$data['urlnowset']?>&nojson=1" data-href="Log Out">Log Out</a></li>
                    <?}?>
                </ul>
            </div>
            <?
           if(count($data['user'])!=0){
             if (defined('NewFeedCheck')) {?>


          <!--  <div class="secWrpList navFtItem w232" >
                <h4 class="sprSec clTxt1 clBd2">New Feed</h4>
                <ul class="grpSecListItem fs03">
                    <li class="listItem <?if($data['templateuser']==3){?>tabSbActived<?}?>"><a class="btnLstSBL" href="<?=baseinfo.'/'.$data['user']['username']?>?myfeed=1" data-href="My Feeds">Feeds</a></li>          
                </ul>
            </div>-->
            
         <? }  }?>
            
            <div class="secWrpList navFtItem w232" >
                <h4 class="sprSec clTxt1 clBd2">Menu</h4>
                <ul class="grpSecListItem fs03">
                     <?
                     $class="tabSbActived";
                     
                     ?>
                     <?if(NameDmconnex=="ADS 2Bsimple"){?>
                     
                    <li class="listItem <?if($data['fid']==0&&$data['nowfeature']['isiframe']!=1){echo $class;}?>"><a class="btnLstSBL" href="<?=baseinfo.'/home'?>" data-href="Everything">Everything</a></li>
                    <?}?>
                     <?
                     if(count($data['feature']))
                     {
                     if($data['user']['roleid'])
                     {
                     
                     $roleid=$data['user']['roleid'];
                     }else
                     {
                     $roleid='0';
                     }
                     
                      foreach($data['feature'] as $valuefeature)
                      {
                         $boolean=true;
                       if(isset($valuefeature['showread']))
                         {


                         if(is_array($valuefeature['showread']))
                         {
                         if(array_search('0',$valuefeature['showread'])!==false)
                         {
                         $boolean=true;
                         }
                         else  if(array_search($roleid,$valuefeature['showread'])!==false)
                         {
                         $boolean=true;
                         
                         }
                         else
                         {
                         $boolean=false;
                         
                         }
                         }
                         else
                         {
                         $boolean=false;
                         
                         }
                         
                         }else
                         {
                         
                         
                         
                         }
                      
                      
                       
                       if($valuefeature['show']&&$boolean)
                       {
                         if($valuefeature['isexternal'])
                       {
                     ?>
                     <li class="listItem <?if($data['fid']==$valuefeature['fid']){echo $class;}?>"><a class="btnLstSBL" href="<?=$valuefeature['link']?>" data-href="<?=$valuefeature['link']?>"><?=ucfirst($valuefeature['name'])?></a></li>
                     
                    <?
                       }              
                       else    if($valuefeature['fid'])
                       {
                     ?>
                     <li class="listItem <?if($data['fid']==$valuefeature['fid']){echo $class;}?>"><a class="btnLstSBL" href="<?=baseinfo.'/'.$valuefeature['link']?>" data-href="<?=$valuefeature['link']?>"><?=ucfirst($valuefeature['name'])?></a></li>
                     
                    <?
                       }else if($valuefeature['isiframe'])
                       {
                      ?> 
                       <li class="listItem <?if($data['nowfeature']['link']==$valuefeature['link']){echo $class;}?>"><a class="btnLstSBL" href="<?=baseinfo.'/'.$valuefeature['link']?>" data-href="<?=$valuefeature['link']?>"><?=ucfirst($valuefeature['name'])?></a></li>
                     <?  
                       }else if($valuefeature['islink'])
                       {
                      ?> 
                       <li class="listItem <?if($data['nowfeature']['link']==$valuefeature['link']){echo $class;}?>"><a class="btnLstSBL" href="<?=baseinfo.'/'.$valuefeature['link']?>" data-href="<?=$valuefeature['link']?>"><?=ucfirst($valuefeature['name'])?></a></li>
                     <?  
                       }else
                       {
                       ?>
                      <li class="listItem <?if($data['fid']==$valuefeature['fid']){echo $class;}?>"><a class="btnLstSBL" href="<?=baseinfo.'/'.$valuefeature['link']?>" data-href="<?=$valuefeature['link']?>"><?=ucfirst($valuefeature['name'])?></a></li> 
                       <?
                       
                       }
                       }
                      }
                     }
                    
                    ?>   
                    
                    <?if(NameDmconnex=="Canonlife"||NameDmconnex=="9ENTERTAIN"){?>
                    <!--<li class="listItem <?if($data['fid']==0&&$data['nowfeature']['isiframe']!=1){echo $class;}?>"><a class="btnLstSBL" href="<?=baseinfo.'/home'?>" data-href="Everything">Everything</a></li>-->
                    <?}?>        
                    
                     <?if(NameDmconnex=="Japan Town"){?>
                    <li class="listItem"><a class="btnLstSBL" target="_blank" href="https://itunes.apple.com/us/app/tpa-bookshelf/id698106889?mt=8" data-href="Everything">Book Store</a></li>
                    <?}?>      
                    
                    
                     <?if(NameDmconnex=="KhonKaenUniversity"){?>
                    <li class="listItem"><a class="btnLstSBL" target="_blank" href="http://library.kku.ac.th" data-href="Everything">Library</a></li>
                    <?}?>          
                           
                </ul>
            </div>
        </div>
    </div>
    <div class="secAddfix clBg2">
    <?if(count($data['user'])!=0){?>
        <div class="btnAddSB fs05 clBd2 cutTxt">
            <div class="wrpUploadCn clearfix">
                <span class="ico3"></span>
                <span class="txtUlCn">Upload</span>
            </div>
        </div>
    <?}?>
      
        <div class="spCrdt fs00">
            <span class="cpR"><?if (defined('FooterData')) {echo FooterData;?><?}else{?>2013 © Infostant  <?}?></span>
            <div class="wrpSecCrdt fs00">
              <span class="cpVer">ver <? if (defined('versionDmconnex')) { echo versionDmconnex; }else{echo $data['version'];}?></span>
                <!-- <a href="/about" class="btnRBtm">About Us</a> -->
            </div>
        </div>
    </div>
</div>
